/*
* @Author: 李杏华
* @Date:   2020-01-11 16:55:45
* @Last Modified by:   李杏华
* @Last Modified time: 2020-01-12 10:24:10
*/










// 头部悬条
$(window).scroll(function(event) {
                        
                        // scrollTop()滚动坐标
                      var a= $('h1').height()+$('nav').height();
                      console.log(a);
                        if($(window).scrollTop()>a){
                              $('h2').show();
                              
                        }else{                             
                              $('h2').fadeOut();
                        }
                  });

//广告图片
$('.show li').hover(function() {
	$(this).children().children('b').css('color', 'white');
	$(this).children('span').css('color', 'white');

	if($(this).index()==0){
		$(this).css('background','#3BA8E0');
		$(this).siblings('li').css('background','');

        $(this).children('em').css("background","url('../images/promote_ph.jpg') no-repeat 0px -240px");
        
	}else if($(this).index()==1){
        $(this).css('background','#D64045');
        $(this).siblings('li').css('background','');

        $(this).children('em').css("background","url('../images/promote_ph.jpg') no-repeat -500px -240px");

	}else if($(this).index()==2){
        $(this).css('background','#009D8A');
        $(this).siblings('li').css('background','');

        $(this).children('em').css("background","url('../images/promote_ph.jpg') no-repeat 0px -720px");

	}else{
		$(this).css('background','#FF7F00');
        $(this).siblings('li').css('background','');

        $(this).children('em').css("background","url('../images/promote_ph.jpg') no-repeat -500px -720px");

	}
}, function() {
	$(this).children().children('b').css('color', 'black');
	$(this).children('span').css('color', 'gray');

	$(this).children('em').css("background","");
});

// .siblings().attr({'background':''})

// 侧边栏

$(window).scroll(function(event) {
                        // 窗口滚动的时候触发
                        console.log($(window).height());
                        // scrollTop()滚动坐标
                        if($(window).scrollTop()>$(window).height()){
                              $('.bottom_p').show();
                              $('.top_0').show();
                              
                        }else{
                              $('.bottom_p').fadeOut();
                              $('.top_0').fadeOut();
                        }
                  });


// 返回顶层
$('.bottom_p').click(function(event) {
                     // 设置滚动坐标 
                     $('html,body').animate({'scrollTop':'0px'},100);
               });
$('.top_0').click(function(event) {
                     // 设置滚动坐标 
                     $('html,body').animate({'scrollTop':'0px'});
               });
  